Handheld client framework system

ABSTRACT

A handheld client framework system provides a server proxy client that services client requests for network accessible information and determines the server that is most appropriate to supply the requested information and sends information request packets to that server across the Internet and/or intranet. Server responses to information requests are received by the server proxy client. The server proxy client separates the response information into the appropriate data components. Data components are sent to the appropriate client. Presentation and logic components are temporarily stored in a one-behind cache on the client. A client will continue to use the presentation and logic components already installed or in the one-behind cache to service the current user request. Any updates sent by the server proxy client and stored in the one-behind cache are retrieved by the client upon subsequent use by the user. The state of the client is saved by the server proxy client so that the client is not dropped when a user, for example, changes from a wired connection to a wireless connection. The invention includes a scripting language that supplies the logic component of the client and gives the client unlimited flexibility by allowing the host to modify the client&#39;s behavior or add new features at any time.

BACKGROUND OF THE INVENTION

[0001] 1. Technical Field

[0002] The invention relates to the data delivery and translation inpersonal electronic devices. More particularly, the invention relates toretrieving and transmitting data available across a network to personaldevices using an adaptable protocol and server proxy client.

[0003] 2. Description of the Prior Art

[0004] Personal data devices have become common accessories in today'stechnology driven society. When PDAs, text pagers, cell phones, andpersonal computers first came into the marketplace, each device had tohave its own custom architecture. The initial systems paved the way fora multitude of communication and operating system standards.

[0005] However, the wide variety of devices have caused problems in thesoftware industry. Application programmers must port their programs toeach device's operating system and display capabilities. For example,one PDA may have a 160×160 pixel black and white display using the PalmOS while another uses a 180×240 color display using WinCE.

[0006] An application programmer must take into account the limitationsof each device when creating the user interface for his program.Differing graphics capabilities between devices make it very difficultto achieve the same look and feel of a GUI across the varied platforms,for example. The application programmer must take into account thatsomething that is easily displayed on one device may not be displayed onanother or may not look the same between two devices.

[0007] CPU speeds also affect application programs. The efficiency of anapplication program must be tweaked for each platform in order for theprogram to be viable. Users do not want to use slow programs on theirpersonal data devices.

[0008] Additionally, personal devices vary greatly in the availablememory and whether the client software is stored in ROM. Small amountsof RAM make it difficult to manage data. While having a client softwarestored in ROM makes it difficult, if not impossible for the normalconsumer, to upgrade.

[0009] All of these limitations create problems for applicationprogrammers.

[0010] A consequence of creating many different versions of a program tosupport different personal data devices is that it causes huge headachesin terms of supporting different code bases. Each code version must bedebugged, updated and supported. When a data packet protocol oroperating system changes, then so must the code base for that system.

[0011] One example is Microsoft Corporation's .NET framework whichattempts to link together XML Web services in servers and clients. The.NET framework requires that all servers and clients communicate usingXML and transfer information in XML. The result is a tightly wovennetwork of XML services. This approach, however, requires that clientdevices process all aspects of the data being requested by users anddisplayed. It also requires application programs to be provided andsupported for each differing platform. Additionally, the processingdemand on the client systems require more powerful processors as thecomplexity of application programs increases.

[0012] It would be advantageous to provide a handheld client frameworksystem that provides a client framework that is easily updateable from ahost system and reduces processing demands on client systems. It wouldfurther be advantageous to provide a handheld client framework systemthat provides a programming language that is easily supported acrossmultiple client platforms.

SUMMARY OF THE INVENTION

[0013] The invention provides a handheld client framework system. Thesystem provides a client framework that is easily updateable from a hostsystem and reduces processing demands on client systems. In addition,the invention provides a programming language that is easily supportedacross multiple client platforms.

[0014] A preferred embodiment of the invention provides a server proxyclient that services client requests for network accessible information.The server proxy client determines the server that is most appropriateto supply the requested information and sends information requests tothat server across the Internet and/or intranet.

[0015] Server responses to information requests are received by theserver proxy client. The server proxy client separates the responseinformation into the appropriate data components. Data components aresent to the appropriate client. Presentation and logic components aretemporarily stored in a one-behind cache on the client. Clients verifywith the server proxy client that the client is using the latest versionof presentation and logic components for the particular task at hand. Ifthe client is not using the latest versions, then it requests an updatefrom the server proxy client. A client will continue to use thepresentation and logic components that currently exist in the one-behindcache to service the current user request. Any updates sent by theserver proxy client and stored in the one-behind cache are retrieved bythe client upon subsequent use by the user.

[0016] The state of the client is saved by the server proxy client sothat the client is not dropped when a user, for example, changes from awired connection to a wireless connection. The user will not have toreauthenticate the client with the server proxy client and the user'ssession will continue as if there were no interruption.

[0017] The invention includes a scripting language that gives the clientunlimited flexibility by allowing the host to modify the client'sbehavior or add new features at any time. The feature set can bedeployed in stages from the server proxy client after the client hasshipped. Client script updates are sent by the server proxy client to aclient.

[0018] Other aspects and advantages of the invention will becomeapparent from the following detailed description in combination with theaccompanying drawings, illustrating, by way of example, the principlesof the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

[0019]FIG. 1 is a block schematic diagram of the invention's serverproxy client communicating with client devices across differentcommunication media according to the invention;

[0020]FIG. 2 is a schematic diagram of a stream object containing astock price response according to the invention;

[0021]FIG. 3 is a schematic diagram of a button object according to theinvention;

[0022]FIG. 4 is a block schematic diagram showing the five layers of apreferred embodiment of the invention according to the invention;

[0023]FIG. 5 is a block schematic diagram of an interface perspective ofa preferred embodiment of the invention's client device and server proxyclient according to the invention;

[0024]FIG. 6 is an exemplary hierarchical object tree representing thederivation of objects according to the invention;

[0025]FIG. 7 is a schematic diagram of a form object according to theinvention;

[0026]FIG. 8 is a schematic diagram of a button object according to theinvention;

[0027]FIG. 9 is a schematic diagram of a form object containing a buttonobject according to the invention;

[0028]FIG. 10 is a schematic diagram of a stream object containing astock price response according to the invention;

[0029]FIG. 11 is a schematic diagram of a root object according to theinvention; and

[0030]FIG. 12 is a schematic diagram of a form object containing dataand logic objects according to the invention.

DETAILED DESCRIPTION OF THE INVENTION

[0031] The invention is embodied in a handheld client framework system.A system according to the invention provides a client framework that iseasily updateable from a host system and reduces processing demands onclient systems. In addition, the invention provides a programminglanguage that is easily supported across multiple client platforms.

[0032] The invention provides a scripting language and client enginethat gives a host system the flexibility to dynamically change thebehavior and appearance of a client system. The client engine is easilyadaptable to different client architectures and user interfaces. Thehost system includes a proxy client that performs the bulk of the dataprocessing of the data accessed by a client system.

[0033] Referring to FIG. 1, the invention provides a host-controllablearchitecture for applications to run on portable (and non-portable)devices such as PDAs, text pagers, cell phones, and personal computers102, 103, 104. A server proxy client 101 is also provided that separatesthe data and presentation aspects of a session, each of which is sentindependently to a client 102, 103, 104, such that the data areavailable without the presentation, e.g., for use independent of thepresentation. The client devices 102, 103, 104, can be connected to theserver proxy client 101 through a wired network 105, phone line 106, orsatellite/wireless connection 107.

[0034] The server proxy client 101 obtains data for client requeststhrough the Internet and/or intranet 108. Data are received by theserver proxy client 101 and are processed into the basic data needed bythe client before being sent to the client 102, 103, 104. Thepresentation aspects of displaying data are separately stored on theserver proxy client and represent display properties that are specificto a particular client application. The separation of data andpresentation components allows the client 102, 103, 104, to reuse thedata for other display forms or to reinterpret the data for otherapplications.

[0035] The invention also provides a persistent proxy client (i.e., theproxy client component of the server proxy client) at the server proxyclient 101 that maintains state for the client 102, 103, 104, whichimproves availability, for example, by allowing a user to switch fromone transport, such as Ethernet, to another transport, such as Ricochet,without losing state or having to reauthenticate the user.

[0036] The invention consists of a client framework and a server proxyclient 101 as noted above. The goal of the client framework is toprovide maximum flexibility by having the client's behavior modifiableby the host. This allows rapid addition of new features to platformsthat might not have a feasible means of updating the client codedirectly, such as a PDA with its client code burned in.

[0037] The invention accomplishes this flexibility by separating thepresentation, logic, and the data components. This enables eachcomponent to be updated independently, thereby reducing network trafficand superfluous requests to the server. Additionally, this framework canbe leveraged across several platforms reducing development time and bugcounts for new clients by having a common, optimized, and tested codebase.

[0038] The server proxy client 101 handles all requests from clients102, 103, 104, and returns the responses in a uniform protocol. Thisgreatly simplifies the responsibility of the client 102, 103, 104, whichno longer has to understand multiple desktop-centric protocols such asHTTP, IMAP, and SMTP. Additional features are deployed from the serverproxy client 101 as they are developed and received by the client 102,103, 104, on demand.

[0039] The invention provides a common framework for building hostcontrolled clients on various platforms such as the Palm OS, WinCE,Linux, Macintosh, and Windows. Once a device that has the client codeburned into ROM has been released to customers, it is difficult, atbest, to update the client. The invention's framework addresses thisissue and several other difficulties involved with creating clients onportable devices.

[0040] The main goal of the framework is to allow the server proxyclient to control and modify the behavior and feature set of the clientwithout having to update the client code. Also, a common framework canbe leveraged by client development to reduce bug counts and developmenttime by sharing a common, optimized, and tested code path.

[0041] The invention's fundamental architecture separates client data,presentation, and logic into distinct components using an XML datamodel. When a client makes a request to the server proxy client, theresponse from the server proxy client comes down as a binary serializedXML data stream that preserves the semantic information of its contents.This allows the client logic, defined by scripts, to identify specificcomponents of the response, make modifications, and utilize the data inany fashion. Additionally, the data sent to the client can be cachedindependent of the presentation, which means that it can be reused byother forms and displayed or reinterpreted in any fashion by the clientlogic at a later time.

[0042] With respect to FIG. 2, the response to a stock quote request 201comes back as a tree of values 202, each tagged with a name. Thisinformation 202 can be used by the logic on the clients to extract onlythe desired components of the request for display.

[0043] The presentation component of the client is also an XML datastream consisting of objects and properties. Properties can be simple,such as integers, strings, and Boolean values, or complex, such asscripts, or binaries that may contain the pixel data for an image, orrich text of a news story. Objects can be UI widgets such as a button,text field, or pop up menu, which have built in integer properties suchas top, left, height and width. Additional built in properties mightinclude a string for a caption or contents.

[0044] A native application can add built-in properties that make sensein view of the specific platform in order to better utilize nativefeatures such as font, size, color, and style. This flexibility isinherent in the invention's design in its uniform treatment of datastreams.

[0045] Referring to FIG. 3, the data model represents these objects andproperties 301 as a simple tree 302 that expresses the layout ofindividual widgets contained in the current form.

[0046] When the user pushes a button on the form, it can activate ascript that sends a request to the server proxy client, such as a stockquote, and has the logic to deal with the contents of the server proxyclient's response to extract the company name and current price and usethose values to populate the text field properties. However, thepristine form will be cached by the client so future requests for thatservice will display the form immediately, but still allow the user tomake interactive requests such as specifying a different symbol for thestock quote or a different address to obtain a map. These forms orfeatures are not burned into the client, rather, they are made availableto the client by the server proxy client.

[0047] The invention's architecture includes a scripting language,described below, which supplies the logic component of the client. Ascript appears as just another property in the form, but it provides theclient with intelligent action. When a user presses a button in apresentation, a script property associated with the button executes (asdescribed below). A script can perform many tasks, from validating inputon the form, to making a request to the server proxy client, to beinginvoked by an object to extract the desired pieces from a response andinsert them into the appropriate places in the presentation. It mightalso modify locations of UI components to adjust for a specific responsefrom the server proxy client, or it could modify the data in theresponse to meet the particular client's display limitations.

[0048] The scripting language gives the client unlimited flexibility byallowing the server proxy client to modify the client's behavior or addnew features at any time. The feature set is no longer a developmentissue for the client but instead can be deployed in stages from theserver proxy client after the client has shipped.

[0049] Another benefit of having active client-side logic manifestsitself in the client's ability to provide much of its functionalitywithout having a connection to the server proxy client. Hence, theclient can still perform during intermittent or lost coverage and havinga server proxy client connection further enriches the user experience byallowing the user to pick up where he left off during the intermittentor lost coverage. Lastly, the ability to update the client from theserver proxy client enhances the client's durability and robustness byallowing certain bugs to be addressed by scripts when updating theclient code directly would not be feasible.

[0050] The strength of the invention is that it offers a means ofdeveloping clients that can be modified and updated after their release.This point cannot be understated. It may appear as if the invention is apresentation package, but that results from the fact that the inventionmust compartmentalize the presentation, data, and logic. In doing so,the functions and features of the client are defined by the invention'sforms made available to the client from the server proxy client. Theactive logic on the client allows that feature set to be much richerthan simple HTML and yet tailored to that particular client.Additionally, the internal structure of the invention means that thedeveloper instantiates only the portions needed and appropriate for thespecific client, producing lightweight and robust clients quickly andefficiently.

[0051] Building a client that utilizes the invention's frameworkinvolves two major facets. First, the system's kernel must be given ameans to access certain common features of the device, which mustusually be routed through the operating system (OS). Secondly, thenative implementation of the client must define the user interfacewidgets that are available on the device if support for the presentationlayer is desired.

[0052] With respect to FIG. 4, the invention's framework is divided intofive layers 401. The presentation layer 402, an object layer containingthe invention's Nachos objects 404 and the system objects 403, an objectruntime layer 405, an abstraction containing a transport abstraction 407and a storage abstraction 406, and a bootstrap application layer 408.

[0053] The bootstrap application 408 contains a native implementation ofthe invention's kernel, and implements the hooks necessary for operationon the device such as transport and storage. The bootstrap application408 can install objects into the runtime to expose services specific tothe device. This layer 408 can host additional functionality not relatedto the invention or incorporate other features not yet supported by theinvention. Alternatively, it can act as a simple “glue” layer to handledevice specific issues, such as communications, and implement the bulkof the user experience by deriving classes from the invention'spresentation layer 402.

[0054] The invention defines an abstract base class calledNachosSystemInterface. The client must derive a class from this baseclass and define all the virtual functions that provide the glue betweenthe invention's framework and the native OS of the device. The virtualfunctions in this class include access to storage functions that definea rudimentary file system, a means of sending packets to AOL, imagerepresentation for that device, and the current time in UTC. Throughthese mechanisms, the invention provides essential functions such ascaching and persistent storage in a database. This storage could beimplemented in the form of RAM, flash memory, or even a hard drive on adesktop client. The invention makes no assumptions about theimplementation that the native code supplies, only that it behaves inthe fashion described in the NachosSytemInterface base class. Althoughthe client can function without these, it would make the client muchslower to respond to requests and preferences or other information couldnot be saved between sessions.

[0055] The second part of developing a native implementation of theinvention requires integration of the user interface (UI) components.The invention defines a set of presentation objects 402 that areabstract representations of common UI widgets such as buttons, edit andstatic text fields, images, checkboxes, popup menus, etc. The nativeclient is not required to implement all the widgets that the inventiondefines, but any widgets that are implemented must be registered withthe runtime object 405 via the registerclass( ) method. This allows theclient the flexibility to support only the widgets that make sense onthat particular device without hard-coding any mandates into theinvention's kernel.

[0056] The native code must derive a class from the invention's baseclass for each widget it implements and provide a means of displayingthat widget. The invention does not perform any hit testing, drawing, orchanges to the native widget on the screen. Instead, the derived classmust handle events such as the creation and destruction of the systempeer, notification that a property of the widget has changed due to userinput, and the ability to notify the base class that the widget wasclicked or selected. The notification of changes and actions that theinvention receives from the derived classes in the native client codeprovides the means of receiving events and input on that particulardevice.

[0057] The invention's architecture also specifies a server proxy clientto simplify the responsibilities of the client application by unifyingall of the communications with the client to a single protocol. Thisreduces the size and complexity of the client by eliminating the need toparse multiple protocols. It also means that new protocols can beaddressed by making changes to the server proxy client instead of havingto update client code.

[0058] The invention has been designed to make it intrinsically robust.No native operation on the invention's hierarchy can corrupt the client.Similarly, the invention's virtual machine (VM) will simply abort thecurrent script if it finds any unexpected data, byte codes, or illegalaccess. Still, it is difficult, if not impossible to test all conditionsfor such a complex environment. There are several compiler switcheswhich log statistics and debugging information relevant to most aspectsof the invention, including, but not limited to the script compiler, thescript runtime VM, and the Message Center.

[0059] The client can optionally maintain a local database accessiblethrough the invention. This database will act as persistent storagebetween sessions to maintain state information, user preferences, and alocal cache.

[0060] The server proxy client will be the sole point of communicationfor all clients. Its architecture must be robust and scalable. Theserver proxy client will communicate with any number of other servers onthe back end to create the data streams that it sends to the clients.However, many clients will not have a direct connection to the server,but instead will communicate over some wireless network. Both client andserver account for such issues as significant latency and lack of orintermittent coverage. The server proxy client becomes the central pointof maintenance for the invention. Once the client has been deployed, itis dependent upon the server proxy client for much of its functionality.Development of content for clients requires the definition of requestand response data stream formats, server components to handle theindividual requests, and forms for device specific presentation.

[0061] The invention addresses many of the constraints that apply tomicro clients by being a lightweight, cross-platform, client framework.The separation of data, presentation, and logic allow each component tobe independently maintained and modified. The bulk of the client'sfeatures move from native client code to the VM. Because of this, theend user's experience on the client can be enhanced and modified withoutupdating the client itself.

[0062] Referring to FIG. 5, an interface perspective of the invention'sclient device 501 and server proxy client 509 is shown. Data requestsare sent from the client 501 either through connectivity medium 1 510 tothe connectivity 1 gateway module 502, through direct connection 503, orthrough connectivity medium 2 511 to the connectivity 2 gateway module504 to the protocol handler module 505. The connectivity gateway modulesconvert from whatever specific protocol is required for the connectivitymedium to an Internet protocol and is then forwarded to the protocolhandler module 505 in the server proxy client 509. The protocol handlermodule 505 interprets the request message and either makes requests ofthe Proxy System module 506 or if the request is for system content(such as presentation or logic components), retrieves system contentfrom the content storage device 507.

[0063] The protocol handler module 505 and the Proxy System module 506in the server proxy client 509, contain the current state of the clientsession between the network hosts module 508 and the client 501. Thisclient session state is independent of the state of the connectivitybetween the client 501 and the protocol handler module 505. The clientsession state can freely transition between the connectivity medium 1510, connectivity medium 2 511, or the direct connection 503 withoutrequiring re-authentication, so to other users, the session isuninterrupted.

[0064] The Proxy System module 506 manages the multiple connections tothe network hosts module 508. The Proxy System module 506 provides anapplication interface that the protocol handler module 505 uses andimplements. The requests for data are correlated with the responses fromthe Proxy System module 506 by the protocol handler module 505 and thedata is then formatted in accordance with the invention's protocol, anda response is sent either through connectivity gateway 1 module 502through connectivity medium 1 510, through direct connection 503, orthrough connectivity gateway 2 module 504 through connectivity medium 2511 to the client 501.

[0065] Requests for content to the protocol handler module 505 arehandled by loading the content stream from the content storage device507. The request contains information about the state of the contentcached on the client device 501, if applicable. If the cached data iscurrent, then a simple response is sent which causes the client to resetthe expiration date of the cached data. If the cached data is notcurrent, then this data is then formatted in accordance with theinvention's protocol and a response is sent either through connectivitygateway 1 module 502 through connectivity medium 1 510, through directconnection 503, or through connectivity gateway 2 module 504 throughconnectivity medium 2 511 to the client 501. before the data isformatted, it is either compiled before the formatting (on demand) orprecompiled and stored on the storage device 507, which option is chosenis dependent upon whether compiling on demand becomes a bottleneck inthe Proxy System module 506.

[0066] Content can be updated on the client 501 by the cache spoilingmechanism described above. A new version of the content is published tothe content storage device 507 and when requests for the content aremade by the client 501, the new version is automatically retrieved fromthe content storage device 507 and sent to the client 501. Content canbe a data, presentation, logic, or any combination of the three.Although the new version is sent to the client 501, the old version ofthe presentation and/or logic will be used by the client 501 toeliminate latency that might be experienced by the end user.

[0067] The new version of the presentation and/or logic are placed in aone-behind cache on the client 501. The next time the user requests thecontent, the client 501 will check the one-behind cache to see if aversion exists for that particular content. When the client 501retrieves content from the one-behind cache, it first checks whether thecontent has expired. The client 501 will always use the currently cachedversion of the presentation and/or logic from the cache. If the contenthas expired, the client 501 will check with the Proxy System module 506to see if a new version is available. If the Proxy System module 506determines that the client 501 has the newest version, anacknowledgement will be sent to the client 501 to reset the expirationdate of the cached content. If the Proxy System module 506 determinesthat a newer version is available, the new version of the presentationand/or logic is sent to the client 501 and placed in a one-behind cacheon the client 501. The version request process described above repeatsif a new version is published to the content storage device 507.

[0068] The client architecture is designed to be efficient, portable andflexible. It is intended to allow for a common code base to leveragemany different platforms.

[0069] Given the design of the invention's kernel, a developer startingon a new client has much less to do than on a usual client development.The invention's kernel itself will take care of most logic andfunctionality of the application. The developer will mainly just need tofocus on two areas: UI integration and system “glue”.

[0070] For the UI integration, the invention provides a set ofpresentation objects that are abstract representations of common UIwidgets. These include such widgets as button, rectangle, image,checkbox, etc. However, these are logical entities only. It is up to theclient developer to extend these with versions that will hook into theUI layer on the target platform.

[0071] The presentation objects are based on the concept of utilizing anative peer. That is, for each NachosButton, the kernel expects that theclient developer provided the code to create a button in the targetplatform's desired UI toolkit. It is also required that the nativebutton will both accept changes from the NachosButton to the peer andpass user interactions from the peer to the NachosButton.

[0072] A client developer is not required to implement classes for allpresentation objects. Only those necessary to support desiredapplications on the target platform must be present. However, developersare encouraged to implement as many objects as reasonable. Any classescreated by the client developer in the presentation objects should beregistered with the runtime's registerclass( ) method. This is how thekernel knows to hook into the classes present for a given version of aclient program, and will not try to utilize unsupported objects.

[0073] The main ancestor class is NachosUIObject. This provides supportfor gluing to a native peer. The two more important methods are_createSystemPeer( ) and _destroySystemPeer( ). These functions musthandle a call properly at any time (including calls to_destroySystemPeer before _createSystemPeer). _createSystemPeer( ) mustbe sure to get its initial state from the properties of the object towhich it is attached. The kernel will call these as needed in order tomaintain a presence in the target platform's UI. In general, any dataand state should be stored in the subclass of the object in order tofree the kernel to destroy and recreate the native peer as needed.

[0074] Subclasses of NachosUIObject include NachosForm and NachosWidget.In Nachos a NachosForm is the main container in which a UI may beconstructed. NachosWidget is the base class for all widgets such asbuttons, images, rectangles, etc. Non-widget subclasses ofNachosUIObject include NachosTimer and NachosItemsObject.

[0075] Each object may have both built-in and run-time properties.Built-in properties cannot be deleted nor renamed, and are guaranteed tobe present in any instances. Any additional properties of an object willbe its children. These could be UI objects, data objects or otherproperties such as scripts, binaries, integers, booleans, or strings.

[0076] With respect to FIG. 6, an exemplary hierarchical object tree 601representing the derivation of objects in the invention is shown.

[0077] NachosForm has the following built-in properties:

[0078] caption—the string title of the form to display in the captionarea

[0079] modal—a boolean to tag the form as modal or non-modal

[0080] keepWhiteboard—a flag for preserving data on the whiteboard whenthe

[0081] form is loaded

[0082] frozen—the UI should not draw the form while this is true

[0083] persistent—this form and its data will be saved even after it isundisplayed

[0084] NachosWidget has the following built-in properties:

[0085] left—the placement of the left edge of the widget in the UI

[0086] top—the placement of the top edge of the widget in the UI

[0087] width—the width of the widget

[0088] height—the height of the widget

[0089] visible—true if the widget is currently visible

[0090] enabled—true if the widget is ‘active’ and will respond to userinput

[0091] Other objects that derive from NachosWidget may have additionalbuilt-in properties. For instance, a button has a caption property thatacts as a label the button, or a rect widget, which as an integer todenote the fill color of the rectangle.

[0092] The coordinates for left and top are absolute coordinates in thedisplay area. Any part of the display that is reserved for the form'scaption does not count for coordinates in the display area. For example,if the form caption area was at the top of the form, top=0 would place awidget at the first pixel below the form caption area.

[0093] Some UI toolkits place native widgets in absolute space and someplace them relative to their parents. It is the job of the clientdeveloper to ensure that any needed transformations of coordinates aredone between the NachosWidget and its native peer.

[0094] The other important part for a client developer to implement isthe code to “glue” the invention to the target platform. Animplementation of NachosSystemInterface needs to be provided to theNachosRuntime upon initialization. The kernel will then use thisimplementation to perform its interactions with the target platform.This includes local storage and network access.

[0095] If storage is supported on the target platform, an implementationof NachosDataStreamInterface should be supplied, plus the additionalneeded methods implemented from NachosSystemInterface.

[0096] An exemplary specification of the invention's scripting languageis shown below.

[0097] Introduction

[0098] The invention's client framework provides a host-controlled,intelligent client. The concept of host controllability offers distinctadvantages over a static client. It allows the rapid addition of newfeatures to clients on platforms that might not have a feasible means ofupdating the client code directly, e.g., devices that have their clientcode burned in. Also, unexpected problems with the client can becircumvented or eliminated by modifying the client's behavior from thehost. Additionally, since a client is more than a dumb terminal thatsimply displays information from the host, it maintains much of itsfunctionality even when not connected to the host. This is particularlyvaluable on clients that have high latency connections or that need tofunction well offline.

[0099] The invention achieves this flexibility by separating thepresentation, logic, and the data from each other using an XML datamodel, which enables each component to be modified or updated by thehost independently of each other. This document will explain some of thefundamental principles of the invention while focusing on theinvention's scripts. In order to use the scripting language effectively,the scriptwriter will need to understand the data model in terms of theinvention's properties, the presentation component in terms of theinvention's widgets, and lastly the capabilities of the scriptinglanguage itself.

[0100] Scripting Properties

[0101] The fundamental building block of the scripting language is aproperty. Every property has a name and a value. The name acts as alabel that can be used when referring to the property. Names ofproperties can be of arbitrary length and consist of any printablecharacter. However, names that start with a letter or underscore and arefollowed by any series of letters, numbers, or underscores are the mosteasily accessed name from the scripting language. The names ofproperties are not case sensitive. Examples of property names are: Homer// this is fine homer // this is good, but is the same name as Homer_bart // okay, this is good _1abc // starting with an underscore isacceptable 155 Springfield Lane // this is a valid property name aswell, // but rather difficult to access from a script

[0102] The value of the property can be one of several types. Simplevalue types are integer, string, and Boolean. These are the mostcommonly used and properties that will be directly examined or modifiedfrom a script HomersHometown “Springfield” // a string propertySimpsonCount 5 // an integer property HomerHungery True // a Booleanproperty

[0103] There are more complex properties such as scripts and binaries.In general, the contents of complex properties cannot be modified from ascript, but the complex property itself can be moved, copied, ordeleted. Binary properties are used for images, large bodies of text,and anywhere you have large “blobs” of data.

[0104] The last kind of property deserves special consideration. It isthe object property.

[0105] Objects

[0106] An object is unique because it acts as a container for otherproperties. Like all properties, an object has a property name, but isalso has a “class”. The class of the object designated by the class namedefines certain attributes about the object such as what properties itcontains by default and what types of additional properties that it cancontain.

[0107] With respect to FIG. 7, an editor tool has been used to create a“form” object 701 named “untitled” 702. When the framework creates aform object 701, it appends certain built-in properties, which cannot beremoved or reordered. A form will always have a string property namedcaption 703, and Boolean properties named modal 704, keepWhiteboard 705,frozen 706, and persistent 707. Each of these properties governs thecharacteristics and behavior of the form such as whether is shouldmaintain its state once it has been displayed (if persistent 707 istrue), or whether it should clear the global area for inter-formcommunication (if keepWhiteboard 705 is false). A “form” is one exampleof an object class, but many classes exist. Another common class is a“button”

[0108] Referring to FIG. 8, all UI widgets in are actually just objectswith certain built-in properties to control its appearance. The button801 has a script 802 which will be called anytime the button object 801receives an “action” message 803, described below.

[0109] With respect to FIG. 9, a button object 902 created in the form901 is shown. By creating an object inside of another object, theproperties can no longer be expressed as a simple list. Instead the form901 now appears as a hierarchy where each property is owned by a parentobject. The button, myButton 902, owns the integer property named left908 and everything below it, while the form owns the properties namedcaption 903, modal 904, keep Whiteboard 905, frozen 906, persistent 907,and myButton 902.

[0110] The other responsibility of an object besides containment ismessage handling.

[0111] Messages

[0112] The unit of communication is a “message” class object. Themessage has a source object and a destination object to which it is sentand usually contains some additional information in an object of class“stream” called parameters. The parameters object acts as the containerfor information required for a request or response. For instance, if ascript sends a message requesting a stock quote for “AOL” the parametersobject of the message it sends would have a property called “sym” with astring value of “aol”.

[0113] Referring to FIG. 10, an exemplary response from the server 1001is shown. In this case parameters 1002 contains another “data” classobject called stream 1003 that holds the stock quote. The script canaccess each of these properties individually by name or index.

[0114] A message also has an echo object of class “stream”, whichcontains any properties that were specifically included in the originalmessage that the sender wants to receive in the reply. This might beused to copy data that generated the request to the recipient of thereply. For example, in a mail application, a script might send a“fetchBody” message to the host carrying along the message ID as anecho, so that when the reply comes back it can associate the responsewith the mail without needing a map of ID's to transactions.

[0115] Many messages have a corresponding reply message. For instance, aload message request will return the results in a reply message.Similarly, a save message sends a notification of completion with areply message. Most scripts use blocking calls to wait for the responseso the name of the reply isn't generally needed. However, there aretimes when the sender might wish to override the default reply name forasynchronous requests which might require specific reply names so theappropriate script can process the response. This can be accomplished bysetting the replyName property to the desired message name. This is usedto demultiplex responses coming back to an object much like the echoparameters are, but in a way that is less general, and often easier touse.

[0116] The Runtime Root

[0117] With respect to FIG. 11, in order for a form to be displayed oran object to receive messages it must by owned by an object known as theruntime 1101. The runtime is an object of class “root” that serves asthe origin of the hierarchy for all active objects.

[0118] The first object of interest is the form stack, forms 1102. Whenthe runtime displays a “form” object, it takes ownership of the new formby placing it in the form stack. The form's UI widgets will be createdand displayed (if the Boolean property, visible, is true). After all thewidgets have been created, the runtime will send the form a “displayed”message so the form can perform any actions immediately after beingdisplayed. From this point on, the form has the ability to send andreceive messages as long as it is owned by the runtime.

[0119] The services object 1103 provides access to a many features thatcan be registered at runtime. One service that it provides by default isthe database object 1104, which offers persistent storage. The databasecan be used to save preferences, high scores, or other data that shouldbe kept from session to session like the user's portfolio or addressbook.

[0120] The aol object 1105 under services 1103 acts as the connection tothe host. Messages requesting data from the server will all be sent tothe aol object 1105 with the appropriate message name corresponding tothe request. For instance, the stock quote in FIG. 10 was a response toa message named “getStockQuote” sent to aol.

[0121] The trash object 1106 acts as a temporary resting place fordeleted properties and locally created objects. The contents of thetrash object 1106 will not be deleted until all scripts have completedexecution because deleted properties might be referenced by anothersuspended or blocked script.

[0122] The whiteboard object 1107 also acts as temporary storage forcommunication between forms, but the lifetime of its contents isgoverned by a different mechanism. One of the built-in properties of aform object is a Boolean called keepWhiteboard. The runtime deletes thecontents of the whiteboard object 1007 any time the runtime displays aform that has keepWhiteboard set to false. This allows data to be passedfrom form to form as long as the next form is expecting it. (i.e.keepWhiteboard is true.)

[0123] Script Overview

[0124] On the client device, the application presents features andservices to the user by using forms. As discussed above, the formscontain UI widgets, such as text fields, check boxes, pop-up menus, andbuttons. Once the user interacts with a widget by clicking a button,changing text, or selecting an item in a list, the form needs to act onthat event. It does so by sending a message to the appropriate widget,but that doesn't accomplish anything in itself. The widget needs to havea script that corresponds to the message that is being received. Forexample, a button receives an “action” message when the user clicks it.If the button widget has a script property called action, that scriptwill be executed to handle the “action” message. Similarly, if thatscript sent a “load” message to aol to get a stock quote, then a replymessage called “reply” will be sent back to the button which can handlethe response with a script called reply which might display selectedproperties from the quote such as the current price.

[0125] The scripts are the form's logic component which give the clientintelligent behavior. By creating new forms on the server, the clientcan get new or updated functionality simply by loading the form anddisplaying it. This type of flexibility shortens the development cycleof the client and increases its longevity by adding to its feature setafter the client has been released.

[0126] Script Basics

[0127] In order to begin programming Script, the scriptwriter must befamiliar with the conventions of representing data, variables, andexpressions. The next few sections will define the constructs of thelanguage and show simple examples of how to use them.

[0128] Being able to reuse scripts will increase reliability and shortenthe time required to develop new features. However, not all code iswritten elegantly, so Script allows you to comment your script using thedouble slash, as in C++. // This is a comment // each comment runs untilthe end of the line .simpsonKidIQs = .iq.bart + .iq.lisa // Maggiehasn't been tested yet!

[0129] There are also C style block comments. The notable difference isthat block comments nest in Script. This is a significant change from C./* This is a comment that can span several lines */ /* Because blockcomments nest /* this comment won't end the block */ Instead you have tobalance the end of the blocks with a closing Comment marker. --> */

[0130] Literal values for integers, Booleans, and strings arerepresented as follows: .lisa.age = 8 // Lisa in eight years old.lisa.says = “I'm going to my room” // Time to do homework.lisa.likesSchool = true // She seems to .bart.age = 0xa // Bart is ten.bart.says = “Ay Carumba!” // What else would he say .bart.likesSchool =false // gonna be a rock star...

[0131] The newline keyword can be used to append a carriage return ontoa string value. .homer.excuse = “Doh!” & newline & “It was like thatwhen I got here” // The string will appear as // Doh! // It was likethat when I got here

[0132] It is also possible to use escape sequences in strings with theback slash ‘\’ followed by ‘n’ for new line, ‘t’ for tab, or ‘x’followed by a two digit hexadecimal value. .homer.excuse = “Doh!\n\tItwas like that when I got here\x2a” // The string will appear as: // Doh!//   It was like that when I got here*

[0133] The statements in Script are terminated by carriage returns.There are no semicolons in the language. In fact, the lexer will gag onthe first errant punctuation it runs across. However, if the statementgets too long, it can be continued on the next line by putting thebackslash as the last character on that line.

[0134] homer.profile=“Springfield Nuclear Power Plant safety inspector”& “,bowler”

[0135] & \

[0136] “, beer drinker” & “, astronaut”//that was just too much for oneline to take

[0137] That should be enough for starters, but in order to access datawe need to know how to follow a path in the hierarchy to a givenproperty.

[0138] Identifiers and Paths

[0139] Scripts allow access to values such as strings, integers, andBooleans that can be stored in properties, which exist in the form,database, or whiteboard. Alternatively, values can be placed intemporary variables that only exist during the execution of the script.Temporary variables must begin with a letter or underscore and can befollowed by any sequence of letters, underscores, or digits. BartAge =10 // sets the variable BartAge to the // integer 10 _santasLittleHelper= true // the dog Simpson5 = “new band” // this is fine 5donuts =“Homer's breakfast” // illegal, cannot begin with a digit

[0140] Path are the means of specifying a location of a property in thehierarchy. The period is the path separator similar to a slash being thedirectory separator in Unix. The basic path components are explicitnames, indices, or name expressions.

[0141] Referring to FIG. 12, Bart's age 1204 could be set with thefollowing expression me.simpons.Bart.age = 10 // sets the age to 10.simpsons.Bart.age = “10” // A string automagically converts to int.simpsons.bart.AGE = 0xa // This is 10 too form.simpons.Bart.age = 10 //an absolute path

[0142] Each of these expressions set Bart's age property to a value of10. The first expression starts with me, which begins the path in thesame object that contains the script. In this case the form object,theSimpsons 1201 contains the script. Following from there, the formowns the simpsons data object 1202, which owns Bart 1203 which owns age1204.

[0143] The second expression uses a shorthand form of me by beginningthe path expression with a period. The third expression shows that pathsare not case-sensitive. The last path is not relative to the script, butstarts with at the top of the form, theSimpsons 1201.

[0144] Now consider the annoy 1205 script in Bart 1203. In order tochange a property in Lisa 1206 relative to Bart 1203 the path needs tomove up the hierarchy. It can do so in the following ways:form.simpsons.Lisa.says = “Bart, quit it!” // absolute pathparent.Lisa.says = “Bart, quit it!”  // backs up to simpsons first..Lisa.says = “Bart, quit it!”     // this is shorthand for parent

[0145] Everything is the same as before, but the parent (or “..”) pathcomponent causes the path to ascend the hierarchy one level from thecurrent position, or from the object that contains the script if itappears as the first part of a path.

[0146] Another way to access elements of a path is to use the index ofthe property. In a path, the square bracket operator is used toreference properties by index. Form.simpsons[1].location = “Moe's” //sets simpsons.Homer.location form.simpsons[2].busy = true // setssimpsons.Marge.busy = True form.simpsons[3][1] = 10 //setssimpsons.Bart.age to 10

[0147] Another convenient way to access a property is by name using anexpression. This allows the script to operate on different properties atruntime without having to directly modify the script. Use theparenthesis preceded by a period or the curly braces to use anexpression as a path name. For example, from Bart.annoy:   // .who =“marge” parent.(.who).says = “go outside and play” // parent.marge.busy= true   // .who = “lisa” parent{.who}.says = “leave me alone” //

[0148] There are also several prefixes that denote special objects inScript. They appear in the table below. PATH PREFIXES AND SPECIALOBJECTS me or “.” The object containing the script. parent or The parentof the object containing the script. “. .” form The form containing thescript. params The parameter object of the message that invoked thescript. whiteboard A special location for storing data for inter-formcommunication. The keepWhiteboard property of the most recentlydisplayed form governs lifetime of data. database Persistent storage forpreferences, hi scores, and state information between sessions.formstack The object that contains all currently displayed forms. errorThe error object can only be referenced in a catch block. It contains astring property (message) and an integer property (type). eparams Theobject in a reply message containing the echo parameters included in theoriginal request message. services The services object in the runtime.Usually unnecessary because the VM will check the services object forany path that it can't resolve.

[0149] Expressions and Operators

[0150] The most common operation in Script is computing the value of anexpression. Expressions are written using operators familiar to mostprogrammers and scriptwriters. The operators “*”, “/”, “+”, and “−”, areused for multiplication, division, addition, and subtraction,respectively. The “=” operator pulls double duty in the language, actingas both the assignment operator and the equality operator. .homer.job =“nuclear engineer” // assigns a string to .homer.job if .homer.job =“office assistant” // this doesn't assign “office assistant” to.homer.job // instead, the equals operator does a case insensitive //compare on string values end

[0151] Unlike C and C++, Script is not a strongly typed language. Whenan integer is assigned to a string property, Script promotes the integerto a string. If a string value that represents an integer is assigned toan integer property, the string will be converted to an integer beforethe assignment. If a string does not represent a base ten number, thenit will be treated as an integer value of zero. When converting fromBoolean, string values are “True” and “False” and integer values are 1and 0. When converting to a Boolean, only the case-insensitive stringvalue “false” and the integer value 0 will be treated as false. Allother values for strings or integers are true. HalfDozen = “6” // Alocal variable .homer.donutsEaten = “none” // donutsEaten is a stringproperty .homer.donutsEaten = 6 + halfDozen // converts to an int(6+6=12) then back to a string = “12” .homer.donutsEaten =.homer.donutsEaten + 1 // now a baker's dozen “13” .donutCount = 5 +“fistful more”  // this is like 5 + 0 .homer.hungry = true // hungry isa Boolean property .homer.hungry = “true” // this converts to true.homer.hungry = 1 // this is also true .homer.hungry = “false” // thisis False!

[0152] If the left hand side of an assignment is a property that doesn'texist, that property will be created as the apparent type of theexpression and assigned the value of the expression. .homer.job =“safety inspector” // only the .job property will be created. // if.homer doesn't exist that is always an error!

[0153] As expected the typical rules of precedence apply. .doh = 4 + 3 *2 // = 10 .doubleDoh = (4 + 3) * 2 // = 14 .dohAgain = 6 + 4 / 2 // = 8.fuguFish = (6 + 4) / 2 // = 5

[0154] The string concatenation operator, “&” is particular to Script.It can be used to append on string to another. .homerSays = “D” & “oh” &“!” // “Doh!” .homerSays = .homerSays & “ We are out of donuts!” //“Doh! We are out of donuts!”

[0155] The logical operators are words, rather than symbols, with theexception of the logical not, which can be written as either “not” or“!”. .homer.hungry = not .homerSleeping // if Homer is awake, he'shungry .homer.hungry = ! .homerSleeping  // just like I said.homer.sleeping = .noDonuts and .remoteControlMissing // if no donutsand can't change the channel, he will sleep .homer.annoyed =flander.ned.present or (.noDonuts and \ ! .homerSieeping) // he iseasily annoyed

[0156] The comparison operator “=” will try to convert its operands tointegers, but if both left and right operands are strings, it willperform a case-insensitive compare.

[0157] Certain operators may be used in conjunction with the assignmentoperator to simplify expressions. Bart.playtime += .bart.studytime //adds studytime to playtime // same as .Bart.playtime = .Bart.playtime +.bart.studytime

[0158] Also, increment and decrement operators can be used asstatements, but not on an expression level. // all the same... .homer.donutsEaten++ ++.homer.donutsEaten .homer.donutsEaten += 1.homer.donutsEaten = .homer.donutsEaten + 1 // not legal!.homer.donutsEaten = .donutCount−− // not an expression level operator

[0159] The complete list of operators, listed in order of precedence,follows: Operator Description ( ) Parenthesis. Higher precedence +, −,not (same as “!”) Unary plus, minus, logical not * / % Multiplication,division, modulus + − Addition, subtraction < > <= >= Less than, greaterthan, LTE, GTE = != equal, not equal & String concatenate and Logicaland or Logical or *=, /=, %=, +=, −=, &= Operation assignment *=, /=,%=, +=, −=, &= RHS evaluated first, then op assign Statement Operators++, −− Pre or postfix increment and decrement

[0160] Conditional Statements

[0161] Script has conditional statements like other languages, but thestatement block needs to be terminated by the keyword end.

[0162] The grammar is:

[0163] if expression

[0164] statements

[0165] end

[0166] Note: examples of this form of conditional statement are: if.homer.atHome   .donutCount = .donutCount −1   // decrease every timeHomer returns end if .bart.inTrouble   .bart.location = “Princip1eSkinner's Office” // just like home   .marge.grayHair =.marge.grayHair + 1  // might be blue hair . . . end

[0167] An else clause might also be added to the if statement before thekeyword end as follows: if expression   statements else   statements end

[0168] Examples of this syntax are: if .duffCount > 0   .duffCount =.duffCount − 1  // don't mind if I do else   .homer.location = “Moe'sTavern”  // store is too far end if .lisa.homework = true   .lisa.busy =“studying”   // highly motivated else   .lisa.busy = “playing saxophone” // and well-balanced end

[0169] One significant different between conditional statements inScript and C/C++ is that multiple Boolean expressions will not beshort-circuited. The bytecodes generated by evaluating the entireexpression are much smaller than inserting a check after each Booleanoperator followed by a conditional jump. This means that: ifexists(.foo) and (.foo > 5)  // careful! (.foo > 5) will ALWAYS beexecuted  // resulting in a thrown exception if it doesn't end

[0170] Also, any number of conditional statements may be chainedtogether using the following syntax: if expression   statements else ifexpression   statements end

[0171] Such as: if .time “ 5:00PM” // this works as a case-insensitivestring compare   .homer.busy = “going home” else if .time = “3:00PM”  if .homer.location = “work”      .homer.busy = “napping”   else     .homer.busy = “watching TV”   end  // terminates the inner if end// terminates the whole if/else if block

[0172] Loops

[0173] Script offers several constructs to facilitate iteration over ablock of statements. The first form of iterator executes the loop afixed number of times with the following syntax: repeatinteger_expression   statements end

[0174] Some examples are: repeat 99   .homer.drink(.duffCount)  // callsthe drink script 99 times end repeat .donutCount  // does NOT decrement.donutCount    .homer.eat( ) // calls the eat script end

[0175] The second type of loop statement will continue executing as longas an expression is true or as long as it is false. repeat whileboolean_expression   statements end repeat until boolean_expression  statements end

[0176] Examples of this are: repeat while .lisa.homework  .lisa.homework =.lisa.study( )   // returns false if there is no morehomework end repeat until .quittingTime   .homer.checkNuclearSafety()     // that's what I'm here for   .homer.checkVendingMachine( )    //need some pork rinds   .quittingTime = .home.checkClock( )  // done at5:00 end

[0177] Perhaps the most familiar form of loop statement is one that usesan iteration variable and sets a beginning and ending limit as follows:repeat with identifier = integer_expression [down] to integer_expression  statements end

[0178] The boundary expressions will only be evaluated once, at thebeginning of the loop. This can either count from a lower bound to anupper bound or from an upper bound to a lower bound if the down keywordis used. .count = 0 repeat with i = 1 to 10   .count = .count + i // sumthe numbers from 1 to 10 end foward = “Smithers” backward = “” repeatwith k = length(forward) down to 1   // reverses the string   backward =backward & getChar(forward, k) end // backward = “srehtimS”

[0179] Similar to C or C++ there are also statements to continue on tothe next iteration of the loop or break out of the loop completely. Asfate would have it, these are the “continue” and “break” statements,respectively. They can appear inside any loop statement. repeat with k =1 to 10   if ! .lisa.homework    break; // done with study loop   elseif .lisa.nextTopic( )    next; // don't study this time, just rest   end  .lisa.study( ) // going for straight A's end

[0180] The last type of loop statement touches all the properties ownedby a given object and all of the children below it to an optionallyspecified depth. If the depth option is not specified then only theimmediate children of the object will be visited. Alternatively, if allnested properties at arbitrary depths need to be visited this can beaccomplished by using the infinity keyword. Lastly, the properties canbe filtered using the objectsOnly keyword. This will skip otherproperties and only iterate over objects. repeat with identifier in path[to depth {integer_expression| infinity}] [objectsOnly]   statements end

[0181] If the script was intended to set all the .busy properties of thesimpsons to “sleeping” in FIG. 6. it could be done with the followingloop. repeat with person in form.simpsons to depth 1 objectsOnly   //every Simpson must rest   person.busy = “sleeping” end

[0182] This can be simplified by noting that all the propertiescontained in forms.simpsons are object, so the objectsOnly filter is notnecessary. Also, because the default iteration depth only visits theimmediate children of the starting object, the depth does not need to beset to a value of one. // this will also put every one to sleep exactlylike // the example above. repeat with person in form.simpsons   //every simpson must rest   person.busy = “sleeping” end

[0183] Arrays

[0184] The invention provides an array property that allows forefficient handling of large blocks of homogeneous data. The type ofinformation that can be stored in an array is limited to string,integer, or Boolean values. The array can be created using the followingsyntax: create array of {int|string|bool} as path // The type of thearray is specified when it is created

[0185] The path can be a local variable or a path to the desiredlocation in the hierarchy including the name of the array property to becreated. create array of string as form.simpsons.Homer.excuses //creates an array of strings in the Homer objects called “excuses”

[0186] Now that the array has been created, there needs to be a means ofadding elements to the array. Creating new elements in an array isaccomplished with the insert statement that has the following syntax:

[0187] insert expression in path at int_expression

[0188] The insert statement will create a new element of the same typeof the array, with a value specified by expression at the index given byint_expression. The array is one based, rather than C/C++ style zerobased arrays. Hence, if zero is given as the index for the insertion, itwill result in an append operation. lameExcuses =form.simpsons.Homer.excuses // save path in local var insert “I don'tknow!” in lameExcuses at 1 // add excuses insert “It was like that whenI got here!” in lameExcuses at 1 insert “How should I know?” inlameExcuses at 2 insert “Don't ask me.” in lameExcuses at 0 // 0 indexdoes append // results in the following array // “It was like that whenI got here!” // “How should I know?” // “I don′t know!” // “Don′t askme.”

[0189] Elements of the array can be accessed with the bracket operator“[ ]”.

[0190] LameExcuses[2]=“I didn't do it!”// replaces “How should I know”

[0191] Individual elements of the array can be removed with the deletestatement as detailed below.

[0192] Dealing with Properties and Objects

[0193] Accessing the contents of individual properties can beaccomplished by evaluating a path to that property, but what happens ifyou want to move or delete a property, or even duplicate an entireobject? Script has statements specifically for those kinds ofoperations.

[0194] In order to delete an object, property, or array element use thedelete statement. In the case of a property, this will actually move theproperty or object specified by path to the trash object until allscripts have completed execution. This is necessary to prevent a scriptfrom holding on to a reference to a property that no longer exists, oreven worse, to prevent disaster when the script deletes itself or theobject in which it is contained. delete path delete .homer.job //removes the job property from .homer detele form.simpsons // they areleaving Springfield

[0195] The delete operator can also be used with elements in an array.Unlike deleting a property, the array element will be removedimmediately without being placed in the trash. Use the bracket “[ ]”operator to specify which element of the array should be deleted. //fromthe example above... delete form.simpsons.Homer.excuses[2] // removes “Ididn't do it!” from the array

[0196] Use the copy statement to copy a property or object from onelocation to another by specifying the source path and a destinationpath. Optional parameters to the copy instruction are destination name,which is a string expression that will be used to rename the property inthe new location, and a destination index, an integer expression thatcan be used as the index at which the property should be inserted intothe hierarchy. The original property name will be used if a destinationargument isn't supplied. Similarly, the property will be copied to theobject after all properties that currently contained by the object.Either of these optional parameters may be omitted, but if both occurthey must be used in the order shown. copy source_path to dest_path <asdest_name> <at dest_index> // copy the homework property to bart withoutchanging the name .lisa.homework to .bart // copy the location propertyto homer and rename it destination copy .donuts.location to .homer as“destination” // copy the location property to homer as the thirdproperty copy .donuts.location to .homer at 3

[0197] The copy statement will not overwrite a property or object if italready exists in the destination object. In that case, the script mustdelete the property at the destination path before copying the newproperty.

[0198] Use the move statement to place a property somewhere else in thehierarchy. The syntax and function is similar to the copy statementexcept that the original property or object will no longer exist in itsformer location. move source_path to dest_path <as dest_name> <atdest_index> // move the porkchop property from the microwave to homer //renaming it as dinner move .kitchen.microwave.porkchop to .homer as“dinner” // the cash property will be renamed allowance and owned bybart move .homer.wallet.cash to .bart as “allowance”

[0199] Each of the previous three statements will work with eithersimple properties (strings, integers, Boolean, scripts, or aliases) orobjects. Making an assignment to a path that has a final property thatdoes not exist will create a simple property, but an object cannot beautomatically generated by the same means. Objects are created via thecreate statement by supplying the class name of the desired object and apath and name of the object to be created. create “class_name” asdest_path // create a new button at the top level of the form create“button” as· form.newButton // create a data object called Flanders forNed and family create “data” as form.neighbor.Flanders

[0200] Dealing with long paths might be cumbersome and prone to errorsso one final feature of Script provides the scriptwriter with theability to make a shortcut of complex paths. By assigning a path of anobject to a local variable, the variable becomes a means of accessingthe properties contained in the path. This improves performance by notre-evaluating the path every time the variable is used. pet =form.Springfield.simpsons.santasLittleHelper // pet now refers tosantasLittleHelper repeat .bart.freetime // bart plays with the dog whennot busy pet.playtlme = pet.playtime + 1 // check to see if the pet hasplayed enough if pet.tired( ) // don't wear the little guy out break endend

[0201] Shortcuts display a unique quality in that they will follow anobject even if that object is moved to another point in the hierarchy.pet = form.Springfield.simpsons.santasLittleHelper // pet now refers tosantasLittleHelper move pet to form as “lostPet” // now the object hasbeen moved and renamed as lostPet if forform.Springfield.simpsons.santasLittleHelper.tired( ) // this object gotmoved so this path isn't valid // which will throw an exception end ifpet.tired( )  // now calls form.lostPet.tired pet.goHome( ) end

[0202] Calling Scripts and Sending Messages

[0203] Many times a script will handle a message that it receives from awidget, such as an action script handling the message that a button wasclicked or a timer expired, but often those scripts will rely upon otherscripts to perform some of the work. Also, requests to the server fordata and forms are often written in the form of a function call. Afunction call uses the following syntax:

[0204] script_path([parameters] [echo echoParameters] [optionsoptionParameters])

[0205] The act of calling a script actually constructs a NACHOS messagewith the name of the call and sends it to the object specified by thepath.

[0206] Referring back to FIG. 11: form.simpsons.Bart.annoy( )  // cansthe annoy script // which actually creates an annoy message and sends it// to the object called “Bart”

[0207] The last component of this function call, annoy, is actually thename of the script or the message being sent.

[0208] Many calls will only have parameters without the additional echoparameters or message options. The recipient of the message can examinethese parameters. For instance, in order to get a stock quote we canmake the call:

[0209] quote=aol.getStockQuote(sym:“aol”)

[0210] In the example above, aol is object that handles the message“getStockQuote”. Additionally, we see the first example of namingparameters. The parameter list to a function is a comma-separated listof expressions. Each expression may be preceded by a name then a colon.In this case sym is the parameter name and “aol” is the value of theparameter. Actually, each parameter is created and copied by value as aproperty of the message object “getStockQuote”, which is why theparameters should be named. This allows the handler of the message onthe other side to refer to the parameters by name, rather than relyingupon the order of appearance in the parameter list. If a name is notsupplied, the parameter will be created as a property called “param”.

[0211] Another example is:

[0212] database.save(path:“homerSimpson”, stream:form.simpsons.homer)

[0213] This saves the homer object in the database as homerSimpson. Thesave message to the database requires two parameters: path, the path inthe database to save the property, and stream: a path to an object orproperty which will be saved. Because these parameters are named, theorder can be reversed without consequence. database.save(stream:form.sirnpsons.homer, path:“homerSimpson”) // same as the abovecall

[0214] Some message will need to define additional options to specifythings such as whether the message should be encrypted, or how long thesystem should wait before it times out the message due to not receivinga response. These parameters can be put in the options block of themessage. aol.sendPrivateMessage (dest:myBuddy, message:text, \ optionsencrypt: true)

[0215] This will allow the native implementation a chance to deal withoptions before sending the message. The only option handled by thekernel is “timeout” which specifies in milliseconds how long the kernelshould wait for a response before throwing an exception. The echoparameters are used for asynchronous messages as discussed below.

[0216] All simple properties (e.g., string, integer, Boolean, binary,script) are passed by value rather than by reference. Objects areusually passed aliases, which acts as an implicit reference. Modifyingproperties contained in the object received as a parameter will modifythe original object. If a message containing aliases leaves the localhierarchy, such as a request sent to the host, then aliases in themessage will be replaced with a copy of the object referenced by thealias. Most of the time this is the desired behavior, but this can stillbe overridden by using the @ operator. // saves a copy of ‘me’ in thedatabase database.save(path:“test1”, stream:me) // saves an alias to‘me’ in the database database.save(path:“test2”, stream:@me)

[0217] Sometimes an object may already have code to respond to amessage. If the object has such native code, which can respond to agiven message, but also contains a script handler for the same message,the script handler will override the native code. Hypothetically, anative application might have code to handle a message called shutdown(), but a script might be used to intercept that message and determine ifthe caller has privileges to issue such a command. In this case, afterconfirming the privileges of the caller, the script may call the utilityfunction, passMessage( ), which will abort the script at the point ofthe call and allow the object to handle the message with its nativecode.

[0218] Aliases have a special behavior when used as parameters in amessage. If the recipient object of the message is local (i.e., theobject lives somewhere under the same runtime root as the sender) thenan alias property will be sent as an alias in the message. This happensbecause the recipient can resolve the alias to the object to obtain anyproperties owned by the object referenced by the alias. However, if themessage is sent off the local environment, the alias property will bereplaced by the object that it references. This can cause a dramaticincrease in size of the message because the underlying object and all ofthe properties it contains will be copied to the message. In many cases,this is the desired effect, but if an alias should not be resolved whensent over the wire, it can be marked as a persistent alias with the @operator. aol.setUpdateListener(listener:@form.proxy)  // this will sendan // alias of the proxy object in the setUpdateListener message to the// aol service, rather than an copy of the proxy object.

[0219] Blocking Calls

[0220] The default behavior of a function call is to block until thefunction that has been called returns. This allows the calling script toprocess the result directly rather than have another script handle theresponse. Referring back to FIG. 9. the last value of a stock quote canbe displayed using the library routine debug( ) as follows:debug(aol.getStockQuote(Sym:”aol”).stream.aol.lastValue)debug(“finished”) // output - // 45.300000 // finished

[0221] There is a lot going on in that last statement. First, agetStockQuote message is sent to the services.aol object. The scriptwill wait until the response comes back before executing any morestatements. Once the reply message returns, the suffix path,.stream.aol.lastValue, gets the desired data from the parameter objectof the message. This is displayed using the library routine debug( ).

[0222] Asynchronous Calls

[0223] By placing the reserved word async in front of a function call,the script will send the message to the object and continue executingwithout waiting for a response. This is more like posting a message thancalling a function. Generally this means that another script will handlethe response to the message as well. The example above can be recreatedusing two scripts that send the message asynchronously and handles theresponse in another script. // 1^(st) script asyncaol.getStockQuote(sym:”aol”) debug (“finished”) // 2^(nd) script -loadComplete // contained in the same object that sent the request //handles the response message debug (params.stream.aol.lastValue) //output - // finished // 45.300000

[0224] Notice that the first script displays “finished” instead ofwaiting for the response message.

[0225] Asynchronous calls present a problem not found with a blockingcalls: the script handling the response is different from the scriptthat initiated the request. Sometimes the script handling the responsemust know certain information pertaining to the original request inorder to handle the response properly. In such a case, echo parametersfacilitate the passing of information from the request to the response.Any parameters passed in the echo block will be moved to the messageresponse and sent back. The echo keyword is used before the block orecho parameters as below: async aol.ping(payload:..data echo timestamp:myServices.time( )) // a hypothetical call to ping the server. // theresponse would have the timestamp parameter as an // echo parameter.Serveral pings could be sent asynchronously // and the response roundtrip time could be determined as well // as seeing if they came out oforder

[0226] Echo parameters should be used judiciously because all echoparameters are sent round trip across the network.

[0227] Return Values

[0228] The return statement allows the script to terminate executionbefore reaching the end or pass a value back to the caller. Anyexpression following a return statement will be evaluated and its resultwill be returned to the script that called the one currently executing.return // terminate the script return expression // pass the value ofexpression back

[0229] Exception Handling

[0230] Script allows the scriptwriter to handle runtime errors in thescript with try/catch blocks. The syntax is as follows: try   statementscatch   statements end

[0231] Any errors that occur between the try and the catch statementwill cause the script to jump to the beginning of the statement listfollowing the catch statement. Inside the catch block the script canreference a special object by specifying the path error. This object hasan integer property, type, and a string property, message, which givethe error number and a short description of the error, respectively. try// .busy will be created if it doesn't exist, but... .homer.busy =.homer.study catch // error if homer.study does not exist // errorobject only accessible within a catch block debug(“*** error “ &error.type & “:” & error.message) end

[0232] Library Functions

[0233] The VM provides a set of built in functions for commonly usedfeatures such as string manipulation and random number generation. Thenames of these functions are case insensitive. However, unlike whensending messages or calling scripts, the parameters to these libraryfunctions aren't named, but rely upon the order of appearance in theargument list. Some of the parameters have default values as listed inthe specification below. The default value can be overridden byincluding that parameter when calling that particular function. When twodefault parameters exist, the apparent type of the parameter is used todistinguish which value is being overridden. An example of this would bethe find( ) function with has a source string, a search pattern, adefault starting position, and a default Boolean to ignore case. If onlythree parameters are listed in the call, then an integer value wouldspecify the starting position while a Boolean would indicate casesensitivity. Utility Functions Void beep(int count=1) int count Thenumber of times to beep. Default value: 1 Description: This functionwill call the system beep count times. Example: beep( ) // will beeponce beep(3) // will beep three times Void debug(string text) stringtext The text to be displayed. Description: This function will displaytext in the system window or debug log. Example: debug(“hello”)  //output -- hello debug(“are you ” & “there”) // are you there VoidgotoURL(string url) string url The URL string to be sent. Description:This function will convert url to a NACHOS message and send it toservices.aol. The url might specify the name of the message and itsparameters, but it will be constructed as a load message if urlspecifies no name. This can be used to load a new form onto the formstack. Example: gotoURL(“nachos://aol/quoteform”)  //loads the // form“quoteform” onto the form stack gotoURL(“nachos://aol/getstockquote&sym=aol”) // sends a “getStockQuote” message withthe “sym” // parameter set to “aol” Void throw(string error) stringerror The text string that will be accessible from the error object in acatch block Description: Throws an exception that will abort the currentscript and all calling scripts until a catch block deals with themessage or the thread is terminated due to the thrown exception. Thetext can be obtained in a catch block by using error.message. Example:throw(“you toss, you catch”)  // will beep once throw(“illegalparameter”) // will beep three times void passMessage( ) Description:Terminates the current script and passes the message, which spawned thescript to the native object code. This can used to filter messages witha script prior to having the object respond to the message with itsnative code. Example: passMessage( )  // let the object handle it voidyield( ) Description: This allows a script to pass control to anotherthread or let new threads spawn to handle queued user input. It isn't agood idea to write scripts with endless loops, but putting a yieldstatement in a long loop will keep the VM from killing the thread byexceeding the time check for an endless loop. Example: yield( )  // letanother script handle messages void sleep(int milliseconds) Description:This will cause the script to block, but will prevent it from timingout. As soon as the specified time elapses, the script will resumeexecution at the next statement. Example: sleep(1500)  // block scriptfor 1.5 seconds property loadURL(string url) string url The URL stringto be sent. Description: This function will convert url to a NACHOSmessage and send it to services.aol. The url might specify the name ofthe message and its parameters, but it will be constructed as a loadmessage if url specifies no name. The result of this call will be passedback to the script. Example: X = loadURL(“nachos://aol/quoteform”) //loads the // form “quoteform” into the variable x

[0234] Math Functions int abs(int value) int value An integer value.Description: Returns the absolute value of the argument value. Example:abs(val) // if val=3, returns 3 abs(val) // if val=−3, returns 3 intmin(int valA, int valB, ...) int valA An integer value. int valB Aninteger value. int ... Additional integer values. Description: Returnsthe minimum number from the set valA, valA, .... Example: min(2, 7) //returns 2 min(0, 5, 3 −1) // returns −1 int max(int valA, int valB, ...)int valA An integer value. int valB An integer value. int ... Additionalinteger values. Description: Returns the maximum number from the setvalA, valA, .... Example: max(2, 7) // returns 7 max(0, 5, 3 −1) //returns 5 int random(int min=1, int max) int min An integer specifyingthe minimum value for the range returned by random. If omitted, thedefault value is 1. int max The largest value that random will return.Description: Returns a random value between min and max, inclusive.Example: random(100) // returns a value from 1 to 100 inclusiverandom(10, 20) // returns a value from 10 to 20 // inclusive int pin(intvalue, int min, int max) int value An integer value. int min Lowerbounds for value. int max Upper bounds for value. Description: Returnsmin if value is less than min, max if value is greater than max or valueotherwise. Example: pin(7, 1, 10)  // returns 7 pin(7, 10, 20) //returns 10 int power(int value, int exponent) int value An integervalue. int exponent An integer that will be used as the exponenent.Description: Returns value raised to exponent. Example: power(2, 3) //returns 2{circumflex over ( )}3 = 8 power(3, 4) // returns 3{circumflexover ( )}4 = 81

[0235] Property Functions Int propertyCount(path property) path propertyA path to a property in the hierarchy or an array. Description: Returnsthe number of properties contained in the top level of the object,property, or 0 if property does not specify an object. This does notrecursively count all the properties contained by other object inproperty. If the argument is an array, propertyCount returns the numberof elements in the array. Example: propertyCount(form.data) // returnsthe number of // properties contained in form.data.PropertyCount(form.myArray) // returns the number // of elements inform.myArray Int count(path property) path property A path to a propertyin the hierarchy or an array. Description: This function is the same aspropertyCount( ). See above. Example: count(form.data) // returns thenumber of // properties contained in form.data. count(form.myArray) //returns the number // of elements in form.myArray Int indexOf(pathproperty) path property A path to a property in the hierarchy.Description: Returns the index of the property in the object containingit. Returns zero if the property does not have a parent. Example:indexOf(form.persistent) // returns 5 (persistent // is a built inproperty of form) string className(path objectProperty) path property Apath to an object property in the hierarchy. Description: Returns theclass name of the object. If the parameter is not an object, thisfunction will return an empty string. Example: className(me) // returnsthe class name of the // object which contains the script (e.g.“button”) Bool exists(path property) path property A path to a propertypossibly in the hierarchy. Description: Returns true if propertyreferences a valid property in the hierarchy, otherwise returns false.Example: exists(form.data.mine) // does this exist? bool isObject(pathproperty) path property A path to a property in the hierarchy.Description: Returns true if property references an object property,otherwise returns false if it is any other type of property. Note thatthe function will throw an exception if property does not exist.Example: isObject(me.child) // is this a property? string name(pathproperty) path property A path to a property in the hierarchy.Description: Returns the name of the property path rather than itsvalue. Example: name(parent) // returns name of the parent object of //the script. The object containing the current // script is ‘me’name(me.data[2]) // returns the name of the second // property in thedata object contained in ‘me’ void rename(path property, string newName)path property A path to a property in the hierarchy. string newName Thenew name of the property. Description: Atempts to change the name of thepath property to newName. Example: rename(me, .caption) // renames theobject containing // the script to be the string contained in .captionrename (me.data[2], “foo”) // renames the second // property in the dataobject contained in ‘me’ // to be “foo”

[0236] String Functions

[0237] Unlike the C/C++ library functions, the functions in this librarydo not modify the source string and all indices are 1 based rather than0 based. Functions return the result of the operation, but the originalarguments are left untouched. In many cases it will be necessary toassign the result back to the source string.

[0238] (e.g. .foo=replace(.foo, “apples”, “oranges”)) int length(stringsrc) string src A string value. Description: Returns the number ofcharacters that src contains. Example: length(“Apple”) // returns 5length(“Bart and Lisa”) // returns 13 string Upper(string src) stringsrc A string value. Description: Returns src with all lower casecharacters converted to upper case. Example: upper(“Marge”) // returns“MARGE” upper(“Bart and Lisa”) // returns “BART AND LISA” stringLower(string src) string src A string value. Description: Returns srcwith all upper case characters converted to lower case. Example:lower(“Marge”) // returns “marge” lower(“Bart and Lisa”) // returns“bart and lisa” string substring(string src, int start, int count)string src A string value. int start The index of the first character ofthe substring. int count The number or characters in the substringDescription: Returns a substring of src beginning at start, containingcount characters. Example: substring(“Homer eats Nachos”, 7, 4) //returns “eats” substring(“Bart and Lisa”, 1, 4) // returns “Bart” stringgetWord(string src, int n=1, string delim=<whitespace>) string src Astring value. int n The index of the desired word in the source string.string delim The set of characters used to delimit words in the sourcestring. Description: Returns the nth word in src separated by any of thecharacters appearing in delim. Example: getWord(“the middle part”, 2) //returns “middle” getWord(“Bart and Lisa”, 2, “ a”) // returns “rt”getWord(“Another sample”) // returns “Another” string removeWord(stringsrc, int n=1, string delim=<white space>) string src A string value. intn The index of the desired word in the source string. string delim Theset of characters used to delimit words in the source string.Description: Returns the string src with then nth word and its trailingdelimiter characters (delim.) removed. Example: RemoveWord(“the middlepart”, 2) // returns “the part” removeWord(“Bart and Lisa”, 2, “ a”) //returns “Band Lisa” removeWord(“Another sample”) // returns “sample” intcountWords(string src, string delim=<whitespace>) string src A stringvalue. string delim The set of characters used to delimit words in thesource string. Description: Returns the number of words in src separatedby any of the characters appearing in delim. Example: CountWords(“Bartand Lisa”) // returns 3 countWords(“Bart and Lisa”, “ a”) // returns 4// the words would be “B”, “rt”, “nd”, & “Lis” stringinsertString(string src, int n, string addStr) string src A stringvalue. int n The index of src at which addStr will be inserted. stringaddStr A string to insert into src. Description: Returns a stringcomposed of addStr inserted in src beginning at the nth character.Example: insertString(“Homer likes Nachos”, 6, “ really”) // returns“Homer really likes Nachos” insertString (“Bart and Lisa”, 2, “ a”) //returns “ B aart and Lisa” string remove(string src, int start, intcount) string src A string value. int start The index of the firstcharacter to be removed. int count The number or characters to beremoved Description: Returns the string src with count charactersremoved beginning at start. Example: remove“Homer really likes Nachos”,6, 7) // returns “Homer likes Nachos” remove(“Spring in the field”, 7,8) // returns “Springfield” string getChar(string src, int n) string srcA string value. int n The index of the desired character in src.Description: Returns the nth character in src Example: getChar(“Homerlikes Nachos”, 13) // returns “N” getChar(“Bart and Lisa”, 10) //returns “L” string setChar(string src, int n, string char) string src Astring value. Int n The index of the desired character in src. Stringchar The new character to be set at n. Description: Returns src with thenth character set to the first character of char. Passing a zero lengthstring for char will effectively remove one character from src. Example:setChar(“Homer likes Nachos”, 13, “M”) // returns “Homer likes Machos”setChar(“Bart and lisa”, 10, “L”) // returns “Bart and Lisa” stringremoveTrailing(string src, string pattern, bool ignoreCase=true) stringsrc A string value. string pattern The search pattern to remove. badignoreCase Boolean to make the search case insensitive. Description:Returns src with all trailing occurrences of pattern removed. Example:removeTrailing(“Homer says, DOHdohdoh”, “doh”) // returns “Homer says, ”removeTrailing(“Homer says, DOHdohdoh”, “doh”, false) // returns “Homersays, DOH” string removeLeading(string src, string pattern, boolignoreCase=true) string src A string value. string pattern The searchpattern to remove. bool ignoreCase Boolean to make the search caseinsensitive. Description: Returns src with all leading occurrences ofpattern removed. Example: removeLeading(“DOHdohdoh, said Homer”, “DOH”)// returns “, said Homer” removeLeading(“DOHdohdoh, said Homer”, “DOH”,false) // returns “dohdoh, said Homer” int compare(string srcA, stringsrcB, bool ignoreCase=true) string srcA A string value. string srcB Astring to be compared with srcA. bool ignoreCase Boolean to make thesearch case insensitive. Description: Returns less than zero if srcA isless than srcB, greater than zero if srcA is greater than srcB, 0 if thetwo strings are the same. A shorthand form for a case insensitivecompare can be performed using the “=” operator. Example: compare(“HOMER”, “homer”) // returns 0 // if a Boolean is acceptable, then this is thesame // as “HOMER” = “homer” compare(“HOMER”, “homer”, false) // returns< 0 compare(“homer”, “HOMER”, false) // returns > 0 int find(string src,string pattern, int n=1, bool ignoreCase=true) string src A stringvalue. string pattern The search pattern. int n The character index atwhich to start the search. bool ignoreCase Boolean to make the searchcase insensitive. Description: Returns the index of the first occurrenceof pattern in src that begins on or after the n th character of src.Example: find(“Homer lives in Springfield”, “spring”) // returns 16find(“Homer lives in Springfield”, “spring”, false) // returns 0find(“Homer eats donuts for dinner”, “er”, 10) // returns 27 ( the “er”in dinner ) bool startsWith(string src, string pattern, boolignoreCase=true) string src A string value. string pattern The searchpattern. bool ignoreCase Boolean to make the search case insensitive.Description: Returns true if src begins with pattern, otherwise false.Example: startsWith(“Homer lives in Springfield”, “homer”) // returnstrue startsWith(“Homer lives in Springfield”, “homer”, false) // returnsfalse bool endsWith(string src, string pattern, bool ignoreCase=true)string src A string value. string pattern The search pattern. boolignoreCase Boolean to make the search case insensitive. Description:Returns true if src ends with pattern, otherwise false. Example:endsWith(“Homer lives in Springfield”, “FIELD”) // returns trueendsWith(“Homer lives in Springfield”, “FIELD”, false) // returns falseint replace(string src, string pattern, string replace, boolignoreCase=true) string src A string value. string pattern The searchpattern. string replace The string which will replace the firstoccurrence of pattern. bool ignoreCase Boolean to make the search caseinsensitive. Description: Returns src with the first occurrence ofpattern replaced by the string replace Example: replace(“DOH doh doh!”,“o”, “*”) // returns “D*H doh doh!” replace(“DOH doh doh!”, “o”, “*”,FALSE) // returns “DOH d*h doh!“ int replaceAll(string src, stringpattern, string replace, bool ignoreCase=true) string src A stringvalue. string pattern The search pattern. string replace The stringwhich will replace any occurrence of pattern. bool ignoreCase Boolean tomake the search case insensitive. Description: Returns src with alloccurrences of pattern replaced by the string replace Example:replace(“DOH doh doh!”, “o”, “*”) // returns “D*H d*h d*h!” replace(“DOHdoh doh!”, “o”, “*”, FALSE) // returns “DOH d*h d*h!”

[0239] Although the invention is described herein with reference to thepreferred embodiment, one skilled in the art will readily appreciatethat other applications may be substituted for those set forth hereinwithout departing from the spirit and scope of the present invention.Accordingly, the invention should only be limited by the claims includedbelow.

1. A process for a framework architecture for client systems, comprisingthe steps of: providing a server proxy client providing means on saidserver proxy client for receiving a client information request from aclient system; providing server determination means on said server proxyclient for determining the proper server to service said client request;sending said client request to said proper server; receiving said properserver's response to said client request; wherein said server proxyclient acts as a proxy client for said client system, performing thebulk of data processing for said client system; wherein said serverproxy client updates said client system with data, presentation, andlogic components using a universal data format; wherein said serverproxy client separates raw data from presentation aspects of saidresponse and places said data into said universal data format; sendingsaid data to said client system; wherein said server proxy clientreceives presentation and logic component updates; and wherein saidpresentation component updates are for a specific client device type. 2.The process of claim 1, wherein said logic component updates are sharedbetween different client device types.
 3. The process of claim 1,further comprising the step of: providing a one-behind cache on saidclient system; and wherein said client system checks said one-behindcache for any presentation or logic components relating to a user'srequest; wherein if any components relating to a user's request existsin said one-behind cache, said client system checks if said componentshave expired; wherein said client system uses said components to servicethe user's request.
 4. The process of claim 3, wherein if saidcomponents have expired, said client system requests any currentversions of the expired components from said server proxy client,wherein said server proxy client checks the current version of arequesting client's presentation and logic components, if any of thepresentation and logic components requires updating, then said serverproxy client retrieves the latest version of any of the presentation andlogic components and sends it to the requesting client, and wherein therequesting client stores the latest version of any of the presentationand logic components in said one-behind cache.
 5. The process of claim1, further comprising the step of: sending said presentation and logiccomponent updates to a client system.
 6. The process of claim 1, whereinsaid client system uses said data and presentation components to createdisplays to a user.
 7. The process of claim 1, wherein said clientsystem reuses said data component for other display purposes.
 8. Theprocess of claim 1, further comprising the step of: providing means onsaid server proxy client for saving a client system's state on storagedevice; and wherein the saved client system's state allows said serverproxy client to continue a client system's session when the clientsystem changes connection methods to or loses coverage with said serverproxy client.
 9. The process of claim 1, further comprising the step of:providing a scripting language; wherein said logic component updates arewritten in said scripting language; wherein said server proxy clientcompiles scripts written in said scripting language into executablebytecodes; wherein said server proxy client updates said client system'sfeatures by sending said client system said executable bytecodes; andwherein said client system executes said executable bytecodes inresponse to a user's input.
 10. The process of claim 9, wherein a clientsystem's presentation aspects are controlled using said scriptinglanguage.
 11. The process of claim 1, wherein communication between saidserver proxy client and said client system is via a binary encoding ofan XML data stream.
 12. A process for dynamically configuring clientsystems, comprising the steps of: providing a host server; providing ascripting language; wherein said host server compiles scripts written insaid scripting language into executable bytecodes; wherein said hostserver, upon receipt of a request for specific up to date presentationcomponents and/or executable bytecodes from a client system, checks ifthe client system's original presentation components and/or executablebytecodes have expired; wherein said host server updates the clientsystem's features by sending the client system updated presentationcomponents and/or executable bytecodes if the original presentationcomponents and/or executable bytecodes on the client system haveexpired; and wherein a client system executes presentation componentsand/or executable bytecodes in response to a user's input.
 13. Theprocess of claim 12, wherein said scripts define program logic.
 14. Theprocess of claim 12, wherein said scripts create and control userinterface displays.
 15. The process of claim 12, wherein said clientsystem receives requested network information from said host serverseparated into data and presentation components.
 16. An apparatus for aframework architecture for client systems, comprising: a server proxyclient; means on said server proxy client for receiving a clientinformation request from a client system; server determination means onsaid server proxy client for determining the proper server to servicesaid client request; a module for sending said client request to saidproper server; a module for receiving said proper server's response tosaid client request; wherein said server proxy client acts as a proxyclient for said client system, performing the bulk of data processingfor said client system; wherein said server proxy client updates saidclient system with data, presentation, and logic components using auniversal data format; wherein said server proxy client separates rawdata from presentation aspects of said response and places said datainto said universal data format; a module for sending said data to saidclient system; wherein said server proxy client receives presentationand logic component updates; and wherein said presentation updates arefor a specific client device type.
 17. The apparatus of claim 16,wherein said logic component updates are shared between different clientdevice types.
 18. The apparatus of claim 16, further comprising: aone-behind cache on said client system; and wherein said client systemchecks said one-behind cache for any presentation or logic componentsrelating to a user's request; wherein if any components relating to auser's request exists in said one-behind cache, said client systemchecks if said components have expired; wherein said client system usessaid components to service the user's request.
 19. The apparatus ofclaim 18, wherein if said components have expired, said client systemrequests any current versions of the expired components from said serverproxy client, wherein said server proxy client checks the currentversion of a requesting client's presentation and logic components, ifany of the presentation and logic components requires updating, thensaid server proxy client retrieves the latest version of any of thepresentation and logic components and sends it to the requesting client,and wherein the requesting client stores the latest version of any ofthe presentation and logic components in said one-behind cache.
 20. Theapparatus of claim 16, further comprising: a module for sending saidpresentation and logic component updates to a client system.
 21. Theapparatus of claim 16, wherein said client system uses said data andpresentation components to create displays to a user.
 22. The apparatusof claim 16, wherein said client system reuses said data component forother display purposes.
 23. The apparatus of claim 16, furthercomprising: means on said server proxy client for saving a clientsystem's state on storage device; and wherein the saved client system'sstate allows said server proxy client to continue a client system'ssession when the client system changes connection methods to or losescoverage with said server proxy client.
 24. The apparatus of claim 16,further comprising: a scripting language; wherein said logic componentupdates are written in said scripting language; wherein said serverproxy client compiles scripts written in said scripting language intoexecutable bytecodes; wherein said server proxy client updates saidclient system's features by sending said client system said executablebytecodes; and wherein said client system executes said executablebytecodes in response to a user's input.
 25. The apparatus of claim 24,wherein a client system's presentation aspects are controlled using saidscripting language.
 26. The apparatus of claim 16, wherein communicationbetween said server proxy client and said client system is via a binaryencoding of an XML data stream.
 27. An apparatus for dynamicallyconfiguring client systems, comprising: a host server; a scriptinglanguage; wherein said host server compiles scripts written in saidscripting language into executable bytecodes; wherein said host server,upon receipt of a request for specific up to date presentationcomponents and/or executable bytecodes from a client system, checks ifthe client system's original presentation components and/or executablebytecodes have expired; wherein said host server updates the clientsystem's features by sending the client system updated presentationcomponents and/or executable bytecodes if the original presentationcomponents and/or executable bytecodes on the client system haveexpired; and wherein a client system executes presentation componentsand/or executable bytecodes in response to a user's input.
 28. Theapparatus of claim 27, wherein said scripts define program logic. 29.The apparatus of claim 27, wherein said scripts create and control userinterface displays.
 30. The apparatus of claim 27, wherein said clientsystem receives requested network information from said host serverseparated into data and presentation components.